using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace NiSis.UserControls
{
    public partial class RifiutoInputBox : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        #region 'NewRifiutoSent' event definition code
        /// <summary>
        ///     EventArgs derived type which holds the custom event fields
        /// </summary>
        [Serializable]
        public class NewRifiutoSentEventArgs : System.EventArgs
        {
            /// <summary>
            ///     Use this constructor to initialize the event arguments
            ///     object with the custom event fields
            /// </summary>
            public NewRifiutoSentEventArgs(string rifiutoText)
            {
                _rifiutoText = rifiutoText;
            }

            private string _rifiutoText;

            public string RifiutoText
            {
                get { return _rifiutoText; }
                set { _rifiutoText = value; }
            }


        }

        /// <summary>
        ///     This represents the delegate method prototype that
        ///     event receivers must implement
        /// </summary>
        public delegate void NewRifiutoSentEventHandler(object sender, NewRifiutoSentEventArgs e);

        /// <summary>
        ///     TODO: Describe the purpose of NewRifiutoSent here
        /// </summary>
        public event NewRifiutoSentEventHandler NewRifiutoSent;

        /// <summary>
        ///     This is the method that is responsible for notifying
        ///     receivers that the event occurred
        /// </summary>
        protected virtual void OnNewRifiutoSent(NewRifiutoSentEventArgs e)
        {
            if (NewRifiutoSent != null)
            {
                NewRifiutoSent(this, e);
            }
        }


        #endregion //('NewRifiutoSent' event definition code)
        public void ShowPopup()
        {
            ModalPopupExtender1.Show();

        }

        protected void cmdOk_Click(object sender, EventArgs e)
        {

            NewRifiutoSentEventArgs ev = new NewRifiutoSentEventArgs(TxtRifiuto.Text);
            NewRifiutoSent(this, ev);
            ModalPopupExtender1.Hide();
        }


    }
}